In data processing systems such as computers and networked workstations, instructions and associated data are transferred from storage devices to one or more processors for processing, and the resulting data generated by the one or more processors typically is returned to the storage devices. Thus, typical processing operations involve frequent and repetitive reading and writing from/to storage devices. As a result, storage access delays are often a primary limitation in the performance of data processing systems; and improving storage access speed may significantly improve the performance of data processing systems.
Due to cost considerations and other design constraints, the use of storage devices having relatively long access times (e.g., hard disk drives or other similar direct access storage devices (DASD's)) is often required. To overcome the resulting performance drawbacks associated with DASD's, cache memories or “caches” may be employed.
A cache typically includes a relatively small, but relatively high speed, bank of memory, that can be more rapidly accessed by a processor than the storage device that the cache services. More specifically, a write cache is used to temporarily store data being written by a processor to a storage device. The processor writes data into the write cache, and thereafter the data is transferred or “destaged” from the write cache to the appropriate storage device. On the other hand, a read cache duplicates storage locations in a storage device, so that when a particular storage location duplicated in the read cache is accessed by a processor, the processor may rapidly access the read cache instead of waiting for access to the storage device.
Generally, a cache has an associated cache directory which stores information regarding the storage locations (of the storage device with which the cache is associated) currently stored in the cache. Thus, when a processor requests access to a particular storage location, the cache directory is accessed to determine whether that storage location is in the cache. If so, the requested storage location may be accessed via the cache. Otherwise, the storage location may be accessed from the storage device with which the cache is associated and/or may be established in the cache, if appropriate.
Typically, sequential storage locations in a storage device such a DASD can be read from or written to rapidly. For example, a disk drive may be arranged into tracks and sectors, so that sequential data can be rapidly read from or written to sequential tracks and sectors of the disk drive. However, long access delays may be incurred when reading or writing data at disparate storage locations of a disk drive. For example, a disk drive typically incurs a substantial delay when moving from one track and sector to another, nonadjacent track and sector.
In view of the rapid access that can be made to sequential storage locations in a storage device, a cache associated with the storage device typically is organized into “lines”, which are relatively long sequences of data from sequential storage locations of the storage device. When storage locations of a storage device are written to using a write cache, the data written into the cache is arranged into cache lines, and one or more sequential cache lines are simultaneously destaged to sequential storage locations of the storage device. Similarly, when storage locations of a storage device are duplicated into a read cache, typically the data from the relevant storage locations as well as neighboring storage locations of the storage device, are brought into a line of the cache.
To store more data in a read cache, data may be compressed prior to being written into the cache memory. Such a cache is referred to as a compressed read cache memory. When an update is made to a compressed read cache memory, it is generally not efficient to decompress and recompress an entire cache line, particularly when the update is to a small section of data of the cache line. For example, a typical update to a cache line containing 256 kbytes of data may be as small as 512 bytes. Nonetheless, conventional compressed read caches require such decompression/recompression of data during updates.
In view of the foregoing, it would be desirable to have a method and a system for updating data in a compressed read cache memory which allow updating of a section of data in a cache line without requiring decompressing and recompressing of the entire cache line. In addition, it would be desirable to have a method and a system that reduce the need to remove data from a cache memory when updating data in the cache memory, and/or that accurately determine which data to remove from the cache memory when removal of data is unavoidable.